package org.rguess.patterns.dyproxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Proxy;
import java.util.Hashtable;
import java.util.Map;

public class HelloWorldTest {

	public static void main(String[] args) {
		IHelloWorld helloWorld = new HelloWorldImpl();
		InvocationHandler handler = new HelloWorldHandler(helloWorld);
		IHelloWorld proxy = (IHelloWorld) Proxy.newProxyInstance(helloWorld.getClass()
				.getClassLoader(), helloWorld.getClass().getInterfaces(), handler);
		System.out.println(proxy.sayHello());
	}
}
